<!DOCTYPE html>
<html lang="en">
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue Template</title>
</head>
<body>
    <div id="app">
        <comp1></comp1>
        <comp2></comp2>
    </div>
<script src="../js/vue.js"></script>
<script>
    Vue.component(
        'comp1',{
            template: `<div>
                <p>全局组件</p> 
            </div>`
        }
    )
    const app = new Vue({
        el: '#app',
        data: {
            message: 'hello Vue!'
        },
        components:{
            'comp2':{
                 template: `<div>
                    <p>局部组件</p> 
                </div>`
            }
        }
    })
</script>
</body>
</html>